﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Reports.GoodsReport
{
    public partial class PrintForm : Form,IntegrationInterface.IDIReport
    {
        Reports.GoodsReport.DataSet _data;
        decimal _allRest;
        decimal _inputTotal;
        decimal _outputTotal;
        public PrintForm(Reports.GoodsReport.DataSet data,decimal allRest,decimal inputTotal,decimal outputTotal)
        {
            _data = data;
            _allRest = allRest;
            _inputTotal = inputTotal;
            _outputTotal = outputTotal;
            InitializeComponent();
        }

        #region IDIReport Members

        public void InitReport(string reportPath)
        {
            CrystalReport1.FileName = reportPath;
            CrystalReport1.Load();
            CrystalDecisions.CrystalReports.Engine.ReportDocument input = CrystalReport1.Subreports["Input"];
            input.SetDataSource(_data);
            //input.SetParameterValue("TotalSum", _inputTotal);
            CrystalDecisions.CrystalReports.Engine.ReportDocument output = CrystalReport1.Subreports["Output"];
            output.SetDataSource(_data.DataOutput as DataTable);
            CrystalReport1.SetDataSource(_data);
            //CrystalReport1.SetParameterValue("AllResr", 0);
           // output.SetParameterValue("Sum", _outputTotal);
        }

        #endregion
    }
}